<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - id:000977,sync:fuzzer2,src:001052.lcov_info_final - src/binary.cpp</title>
  <link rel="stylesheet" type="text/css" href="../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../index.html">top level</a> - <a href="index.html">src</a> - binary.cpp<span style="font-size: 80%;"> (source / <a href="binary.cpp.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">id:000977,sync:fuzzer2,src:001052.lcov_info_final</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntry">45</td>
            <td class="headerCovTableEntryLo">0.0 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2016-03-13 10:42:47</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntry">2</td>
            <td class="headerCovTableEntryLo">0.0 %</td>
          </tr>
          <tr><td><img src="../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : #include &quot;yaml-cpp/binary.h&quot;</a>
<span class="lineNum">       2 </span>            : 
<span class="lineNum">       3 </span>            : namespace YAML {
<span class="lineNum">       4 </span>            : static const char encoding[] =
<a name="5"><span class="lineNum">       5 </span>            :     &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/&quot;;</a>
<span class="lineNum">       6 </span>            : 
<span class="lineNum">       7 </span><span class="lineNoCov">          0 : std::string EncodeBase64(const unsigned char *data, std::size_t size) {</span>
<span class="lineNum">       8 </span><span class="lineNoCov">          0 :   const char PAD = '=';</span>
<span class="lineNum">       9 </span>            : 
<span class="lineNum">      10 </span><span class="lineNoCov">          0 :   std::string ret;</span>
<span class="lineNum">      11 </span><span class="lineNoCov">          0 :   ret.resize(4 * size / 3 + 3);</span>
<span class="lineNum">      12 </span><span class="lineNoCov">          0 :   char *out = &amp;ret[0];</span>
<span class="lineNum">      13 </span>            : 
<span class="lineNum">      14 </span><span class="lineNoCov">          0 :   std::size_t chunks = size / 3;</span>
<span class="lineNum">      15 </span><span class="lineNoCov">          0 :   std::size_t remainder = size % 3;</span>
<span class="lineNum">      16 </span>            : 
<span class="lineNum">      17 </span><span class="lineNoCov">          0 :   for (std::size_t i = 0; i &lt; chunks; i++, data += 3) {</span>
<span class="lineNum">      18 </span><span class="lineNoCov">          0 :     *out++ = encoding[data[0] &gt;&gt; 2];</span>
<span class="lineNum">      19 </span><span class="lineNoCov">          0 :     *out++ = encoding[((data[0] &amp; 0x3) &lt;&lt; 4) | (data[1] &gt;&gt; 4)];</span>
<span class="lineNum">      20 </span><span class="lineNoCov">          0 :     *out++ = encoding[((data[1] &amp; 0xf) &lt;&lt; 2) | (data[2] &gt;&gt; 6)];</span>
<span class="lineNum">      21 </span><span class="lineNoCov">          0 :     *out++ = encoding[data[2] &amp; 0x3f];</span>
<span class="lineNum">      22 </span>            :   }
<span class="lineNum">      23 </span>            : 
<span class="lineNum">      24 </span><span class="lineNoCov">          0 :   switch (remainder) {</span>
<span class="lineNum">      25 </span>            :     case 0:
<span class="lineNum">      26 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">      27 </span>            :     case 1:
<span class="lineNum">      28 </span><span class="lineNoCov">          0 :       *out++ = encoding[data[0] &gt;&gt; 2];</span>
<span class="lineNum">      29 </span><span class="lineNoCov">          0 :       *out++ = encoding[((data[0] &amp; 0x3) &lt;&lt; 4)];</span>
<span class="lineNum">      30 </span><span class="lineNoCov">          0 :       *out++ = PAD;</span>
<span class="lineNum">      31 </span><span class="lineNoCov">          0 :       *out++ = PAD;</span>
<span class="lineNum">      32 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">      33 </span>            :     case 2:
<span class="lineNum">      34 </span><span class="lineNoCov">          0 :       *out++ = encoding[data[0] &gt;&gt; 2];</span>
<span class="lineNum">      35 </span><span class="lineNoCov">          0 :       *out++ = encoding[((data[0] &amp; 0x3) &lt;&lt; 4) | (data[1] &gt;&gt; 4)];</span>
<span class="lineNum">      36 </span><span class="lineNoCov">          0 :       *out++ = encoding[((data[1] &amp; 0xf) &lt;&lt; 2)];</span>
<span class="lineNum">      37 </span><span class="lineNoCov">          0 :       *out++ = PAD;</span>
<span class="lineNum">      38 </span><span class="lineNoCov">          0 :       break;</span>
<span class="lineNum">      39 </span>            :   }
<span class="lineNum">      40 </span>            : 
<span class="lineNum">      41 </span><span class="lineNoCov">          0 :   ret.resize(out - &amp;ret[0]);</span>
<span class="lineNum">      42 </span><span class="lineNoCov">          0 :   return ret;</span>
<span class="lineNum">      43 </span>            : }
<span class="lineNum">      44 </span>            : 
<span class="lineNum">      45 </span>            : static const unsigned char decoding[] = {
<span class="lineNum">      46 </span>            :     255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
<span class="lineNum">      47 </span>            :     255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
<span class="lineNum">      48 </span>            :     255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 62,  255,
<span class="lineNum">      49 </span>            :     255, 255, 63,  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  255, 255,
<span class="lineNum">      50 </span>            :     255, 0,   255, 255, 255, 0,   1,   2,   3,   4,   5,   6,   7,   8,   9,
<span class="lineNum">      51 </span>            :     10,  11,  12,  13,  14,  15,  16,  17,  18,  19,  20,  21,  22,  23,  24,
<span class="lineNum">      52 </span>            :     25,  255, 255, 255, 255, 255, 255, 26,  27,  28,  29,  30,  31,  32,  33,
<span class="lineNum">      53 </span>            :     34,  35,  36,  37,  38,  39,  40,  41,  42,  43,  44,  45,  46,  47,  48,
<span class="lineNum">      54 </span>            :     49,  50,  51,  255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
<span class="lineNum">      55 </span>            :     255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
<span class="lineNum">      56 </span>            :     255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
<span class="lineNum">      57 </span>            :     255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
<span class="lineNum">      58 </span>            :     255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
<span class="lineNum">      59 </span>            :     255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
<span class="lineNum">      60 </span>            :     255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
<span class="lineNum">      61 </span>            :     255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
<span class="lineNum">      62 </span>            :     255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
<span class="lineNum">      63 </span>            :     255,
<a name="64"><span class="lineNum">      64 </span>            : };</a>
<span class="lineNum">      65 </span>            : 
<span class="lineNum">      66 </span><span class="lineNoCov">          0 : std::vector&lt;unsigned char&gt; DecodeBase64(const std::string &amp;input) {</span>
<span class="lineNum">      67 </span>            :   typedef std::vector&lt;unsigned char&gt; ret_type;
<span class="lineNum">      68 </span><span class="lineNoCov">          0 :   if (input.empty())</span>
<span class="lineNum">      69 </span><span class="lineNoCov">          0 :     return ret_type();</span>
<span class="lineNum">      70 </span>            : 
<span class="lineNum">      71 </span><span class="lineNoCov">          0 :   ret_type ret(3 * input.size() / 4 + 1);</span>
<span class="lineNum">      72 </span><span class="lineNoCov">          0 :   unsigned char *out = &amp;ret[0];</span>
<span class="lineNum">      73 </span>            : 
<span class="lineNum">      74 </span><span class="lineNoCov">          0 :   unsigned value = 0;</span>
<span class="lineNum">      75 </span><span class="lineNoCov">          0 :   for (std::size_t i = 0; i &lt; input.size(); i++) {</span>
<span class="lineNum">      76 </span><span class="lineNoCov">          0 :     unsigned char d = decoding[static_cast&lt;unsigned&gt;(input[i])];</span>
<span class="lineNum">      77 </span><span class="lineNoCov">          0 :     if (d == 255)</span>
<span class="lineNum">      78 </span><span class="lineNoCov">          0 :       return ret_type();</span>
<span class="lineNum">      79 </span>            : 
<span class="lineNum">      80 </span><span class="lineNoCov">          0 :     value = (value &lt;&lt; 6) | d;</span>
<span class="lineNum">      81 </span><span class="lineNoCov">          0 :     if (i % 4 == 3) {</span>
<span class="lineNum">      82 </span><span class="lineNoCov">          0 :       *out++ = value &gt;&gt; 16;</span>
<span class="lineNum">      83 </span><span class="lineNoCov">          0 :       if (i &gt; 0 &amp;&amp; input[i - 1] != '=')</span>
<span class="lineNum">      84 </span><span class="lineNoCov">          0 :         *out++ = value &gt;&gt; 8;</span>
<span class="lineNum">      85 </span><span class="lineNoCov">          0 :       if (input[i] != '=')</span>
<span class="lineNum">      86 </span><span class="lineNoCov">          0 :         *out++ = value;</span>
<span class="lineNum">      87 </span>            :     }
<span class="lineNum">      88 </span>            :   }
<span class="lineNum">      89 </span>            : 
<span class="lineNum">      90 </span><span class="lineNoCov">          0 :   ret.resize(out - &amp;ret[0]);</span>
<span class="lineNum">      91 </span><span class="lineNoCov">          0 :   return ret;</span>
<span class="lineNum">      92 </span>            : }
<span class="lineNum">      93 </span>            : }
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.11</a></td></tr>
  </table>
  <br>

</body>
</html>
